<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <title>高德地图</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
  <style>
    html, body,
    #container {
      margin: 0;
      padding: 0;
      width: 100%;
      height: 100%;
    }
  </style>
</head>
<body>
<div id="container"></div>
<script type="text/javascript" src="https://webapi.amap.com/maps?v=2.0&key=07610dc06ca6ec4a5fd3e9dd37b8231f"></script>
<script>
  window._AMapSecurityConfig = {
    securityJsCode:'07610dc06ca6ec4a5fd3e9dd37b8231f'
  }

  var map = new AMap.Map('container', {
    zoom: 15,
    viewMode: '3D'
  })

  if (getQueryString('position')) {
    var lng = getQueryString('position').split(',')[0]
    var lat = getQueryString('position').split(',')[1]
    var marker = new AMap.Marker({
      position: new AMap.LngLat(lng, lat)
    })

    map.add(marker)
    map.setCenter([lng,lat])
  }

  function getQueryString(name) {
    var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i')
    var r = window.location.search.substr(1).match(reg)
    if (r !== null) return unescape(r[2])
    return null
  }
</script>
</body>
</html>
